Uninitialized size before xcalloc fixed
authoroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 22 Oct 2005 21:32:37 +0000 (21:32 +0000)
committeroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 22 Oct 2005 21:32:37 +0000 (21:32 +0000)
gpsbabel/coto.c

index d3d363b082ca512a756c5b16922f31d4bcaf9b58..1869aa2edcaef331fd5d121e07ebfe0691087091 100644 (file)
@@ -361,6 +361,8 @@ coto_wpt_write(const waypoint *wpt)
        {
                notes = xstrdup(wpt->notes);
        }
+
+       size = sizeof(*rec);
        if (notes != NULL)
                size += strlen(notes);
        rec = xcalloc(size, 1);